package com.erp.erp_servers.warehouse.imp;

import com.erp.erp_dao.warehouse.ISellOutStockDao;
import com.erp.erp_entitys.warehouse.entity.SellOutStockEntity;
import com.erp.erp_entitys.warehouse.req.SellOutStockInfoByPageReq;
import com.erp.erp_entitys.warehouse.req.sellOutStockStatistics1Req;
import com.erp.erp_entitys.warehouse.rsp.sellOutStockStatistics1Rsp;
import com.erp.erp_servers.warehouse.ISellOutStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : SellOutStockServiceImp
 * @Description : 销售出库实现类
 * @Author : lst
 * @Date: 2020-08-17 19:40
 */
@Service
public class SellOutStockServiceImp implements ISellOutStockService {

    /**
     * 销售出库接口
     */
    private final ISellOutStockDao sellOutStockDao;

    @Autowired
    public SellOutStockServiceImp(ISellOutStockDao sellOutStockDao) {
        this.sellOutStockDao = sellOutStockDao;
    }

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public SellOutStockEntity queryById(Integer id) {
        return sellOutStockDao.queryById(id);
    }

    /**
     * 通过实体作为筛选条件查询
     *
     * @param sellOutStock 实例对象
     * @return 对象列表
     */
    @Override
    public List<SellOutStockEntity> queryAll(SellOutStockEntity sellOutStock) {
        return sellOutStockDao.queryAll(sellOutStock);
    }

    /**
     * 新增数据
     *
     * @param sellOutStock 实例对象
     * @return 影响行数
     */
    @Override
    public int insert(SellOutStockEntity sellOutStock) {
        return sellOutStockDao.insert(sellOutStock);
    }

    /**
     * 修改数据
     *
     * @param sellOutStock 实例对象
     * @return 影响行数
     */
    @Override
    public int update(SellOutStockEntity sellOutStock) {
        return sellOutStockDao.update(sellOutStock);
    }


    /**
     * 销售出库分页信息
     * @param req 查询参数
     * @return 销售出库分页信息
     */
    @Override
    public List<SellOutStockEntity> getListByPage(SellOutStockInfoByPageReq req) {
        return sellOutStockDao.getListByPage(req);
    }

    @Override
    public List<sellOutStockStatistics1Rsp> sellOutStockStatistics1List(sellOutStockStatistics1Req req) {
        return sellOutStockDao.sellOutStockStatistics1List(req);
    }
}
